import { AUTH } from '../helpers/axios'

const getUser = async (id) => {
  return AUTH.get(`/api/v1/authserver/users/${id}`)
}

const login = async ({ name, password, accountId }) => {
  return AUTH.post(
    `/api/v1/authserver/accounts/login`,
    {
      name: name,
      password: password,
      tenantId: accountId
    }
  )
}

const getProfile = async (id) => {
  return AUTH.get(`/api/v1/authserver/customProfile`)
}

export {
  getUser,
  login,
  getProfile
}
